﻿@model Home.WebUI.Areas.Admin.Models.SalesmanViewModel.IndexViewModel
@using Home.WebUI.Models.HtmlHelpers
@{
    ViewBag.Title = "青神园林工程有限公司CMS管理系统";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
    string controllerName = Request.RequestContext.RouteData.Values["controller"].ToString();
}
@section head{

 <script src="/Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        $("[name='Delete']").click(
    function () {
        if (confirm("确定要删除\""+$(this).attr("tip")+"\"吗？")) {
            var stuid = $(this).attr("stuid");
             var tr = $(this).parent().parent();
            $.post("@Url.Action("Delete")", { id: stuid }, function (data) {
                if (data == "-1") { alert("删除失败"); }
                else {
                    $(tr).remove(); alert("删除成功");
                }
            });
        }
    }); 
       });
</script>
}
<div id="bdw" class="bdw">
<div id="bd" class="cf">
<div id="coupons">
	<div class="dashboard" id="dashboard">
		<ul><li class="current"><a href="@Url.Action("Index")">@(ViewBag.ColumnTitle)列表</a><span></span></li><li><a href="@Url.Action("Create")">新建@(ViewBag.ColumnTitle)</a><span></span></li></ul>
	</div>
    <div id="content" class="coupons-box clear mainwide">
		<div class="box clear">
            <div class="box-top"></div>
            <div class="box-content">
            <div class="head">
				                    <h2>@(ViewBag.ColumnTitle)列表</h2>
				</div>
                <div class="sect" style="padding:0 10px;">
					<form action="@Url.Action("Index")" method="post">
                       <p style="margin:5px 0;"> 标题：@Html.TextBoxFor(model => model.Search, new {@class="h-input"  }) &nbsp;<input type="submit" value="筛选" class="formbutton" style="padding: 1px 6px;" />
                        </p></form>
				</div>
                <div class="sect">
					<table id="orders-list" cellspacing="0" cellpadding="0" border="0" class="coupons-table">
					<tr>
                        <th width="150">ID</th>
                        <th width="200">用户名</th>
                        <th width="200">姓名</th>
                        <th width="150" style="white-space: nowrap">创建时间</th>
                        <th width="150">操作</th>
                    </tr>
                     @{int beijing = 1;
                       foreach (var item in Model.Salesmans)
                       {
                           beijing++;
				    <tr @(beijing % 2 == 1 ? null : Html.Raw(@"class=""alt""")) id="team-list-id-244">
						
						<td>@item.Id</td>
                        <td>@item.UserName</td>
						<td>@item.Name</td>
						<td>@string.Format("{0:yyyy-MM-dd}",item.CreateDate)</td>
						<td>
                        @Html.ActionLink("编辑","Edit",new{id=item.Id})|<a href="javascript:void(0)" name="Delete" tip="@item.Name" stuid="@item.Id">删除</a>
                        </td>
					</tr>
                       }
                       }
																			
				   @* <tr><td colspan="4"><ul class="paginator"><li>(84)</li><li class="current">1</li><li><a href='/manage/team/success.php?page=2'>2</a><li><li><a href='/manage/team/success.php?page=3'>3</a><li><li><a href='/manage/team/success.php?page=4'>4</a><li><li><a href='/manage/team/success.php?page=5'>5</a><li><li><a href='/manage/team/success.php?page=2'>下一页</a></li><li><a href='/manage/team/success.php?page=5'>末页</a></li></ul></td></tr>*@
                    @*<tr><td colspan="4">@Html.Pager(Model, new PagerOptions { CssClass = "paginator", ContainerTagName = "ul", PageIndexParameterName = "pageindex", MorePagerItemWrapperFormatString = "<li>{0}</li>", NavigationPagerItemWrapperFormatString = "<li>{0}</li>", FirstPageText = "首页", LastPageText = "尾页", ShowPrevNext = false, CurrentPagerItemWrapperFormatString = "<li>{0}</li>", NumericPagerItemWrapperFormatString = "<li>{0}</li>" })</td></tr>*@
                    <tr><td colspan="4"><ul class="paginator">@Html.PageLinks(Model.PagingInfo, x => Url.Action("Index", new { Page = x }))</ul></td></tr>
                    </table>
				</div>
            </div>
            <div class="box-bottom"></div>
        </div>
    </div>
</div>
</div> <!-- bd end -->
</div>
